#include "sqlconsole.h"
#include "ui_sqlconsole.h"

SqlConsole::SqlConsole(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::SqlConsole)
{
    m_ui->setupUi(this);
    model = new QSqlQueryModel();
    m_ui->tvResult->setModel(model);
}

SqlConsole::~SqlConsole()
{
    delete m_ui;
}

void SqlConsole::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void SqlConsole::on_pbExecute_clicked()
{
    model->setQuery(m_ui->pteQuery->toPlainText());
    m_ui->lLastError->setText(model->lastError().text());
}

void SqlConsole::on_pbLoadFile_clicked()
{


}









